<!-- 使用 type="home" 属性设置首页，其他页面不需要设置，默认为page；推荐使用json5，更强大，且允许注释 -->
<route lang="json5" type="page">
{
  style: {
    navigationBarTitleText: '报修明细',
    navigationBarTextStyle: '#000000',
    navigationStyle: 'custom',
    navigationBarBackgroundColor: '#ffffff',
  },
}
</route>
<template>
  <view class="w-[100vw] h-[100vh] box-border contentBox">
    <wd-form v-if="code == 0" ref="form" :model="model">
      <wd-cell-group custom-class="group" border>
        <wd-select-picker
          label="提交人"
          v-model="model.examineUser"
          :columns="userList"
          label-width="100px"
          readonly
          placeholder="暂无数据"
          prop="examineUser"
          type="radio"
          clearable
          filterable
        ></wd-select-picker>
        <wd-select-picker
          label="宿舍"
          v-model="model.examineUser"
          :columns="userList"
          label-width="100px"
          prop="examineUser"
          readonly
          placeholder="暂无数据"
          type="radio"
          clearable
          filterable
        ></wd-select-picker>
        <wd-calendar
          type="date"
          readonly
          label-width="100px"
          placeholder="暂无数据"
          prop="examineTime"
          v-model="model.examineTime"
          label="报修日期"
        />
        <wd-select-picker
          label="报修设施"
          v-model="model.examineUser"
          :columns="userList"
          readonly
          placeholder="暂无数据"
          label-width="100px"
          prop="examineUser"
          type="radio"
          clearable
        ></wd-select-picker>
        <wd-select-picker
          label="设施类型"
          v-model="model.examineUser"
          :columns="userList"
          readonly
          placeholder="暂无数据"
          label-width="100px"
          prop="examineUser"
          type="radio"
          clearable
        ></wd-select-picker>
        <wd-input
          label="问题描述"
          placeholder="暂无数据"
          label-width="100px"
          readonly
          prop="tmpDesc"
          clearable
          v-model="model.tmpDesc"
        />
        <wd-calendar
          type="date"
          readonly
          label-width="100px"
          placeholder="暂无数据"
          prop="examineTime"
          v-model="model.examineTime"
          label="解决日期"
        />
      </wd-cell-group>
    </wd-form>
    <wd-form v-else ref="form" :model="model">
      <wd-cell-group custom-class="group" border>
        <wd-select-picker
          label="提交人"
          v-model="model.examineUser"
          :columns="userList"
          label-width="100px"
          placeholder="请选择提交人"
          :rules="[{ required: true, message: '请选择提交人' }]"
          prop="examineUser"
          type="radio"
          clearable
          filterable
        ></wd-select-picker>
        <wd-select-picker
          label="宿舍"
          v-model="model.examineUser"
          :columns="userList"
          label-width="100px"
          prop="examineUser"
          :rules="[{ required: true, message: '请选择宿舍' }]"
          placeholder="请选择宿舍"
          type="radio"
          clearable
          filterable
        ></wd-select-picker>
        <wd-calendar
          type="date"
          label-width="100px"
          placeholder="请选择报修日期"
          prop="examineTime"
          :rules="[{ required: true, message: '请选择报修日期' }]"
          v-model="model.examineTime"
          label="报修日期"
        />
        <wd-select-picker
          label="报修设施"
          v-model="model.examineUser"
          :columns="userList"
          :rules="[{ required: true, message: '请选择报修设施' }]"
          placeholder="请选择报修设施"
          label-width="100px"
          prop="examineUser"
          type="radio"
          clearable
        ></wd-select-picker>
        <wd-select-picker
          label="设施类型"
          v-model="model.examineUser"
          :columns="userList"
          :rules="[{ required: true, message: '请选择设施类型' }]"
          placeholder="请选择设施类型"
          label-width="100px"
          prop="examineUser"
          type="radio"
          clearable
        ></wd-select-picker>
        <wd-input
          label="问题描述"
          :rules="[{ required: true, message: '请输入问题描述' }]"
          placeholder="请输入问题描述"
          label-width="100px"
          prop="tmpDesc"
          clearable
          v-model="model.tmpDesc"
        />
      </wd-cell-group>
    </wd-form>
    <view class="bottomBox" v-if="code == 1">
      <wd-button plain @click="goBack">取消</wd-button>
      <wd-button>确认</wd-button>
    </view>
  </view>
</template>

<script setup>
import { onLoad, onReachBottom } from '@dcloudio/uni-app'

defineOptions({
  name: 'RepairEdit',
})

const model = ref({})
const form = ref(null)
const userList = ref([])
const code = ref(1)

const submit = () => {}

onLoad(() => {})

const goBack = () => {
  uni.navigateBack()
}

// 初始化
</script>

<style lang="scss" scoped>
.contentBox {
  background-color: #f1f1f1;
  padding: 30upx;
  .bottomBox {
    height: 180upx;
    background-color: white;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 30px;
    box-sizing: border-box;
  }
}
</style>
